<!-- 历史赛事 -->
<template>
	<div id="history-competiton">
		<img :src="hisevent.url" alt="图片没了">
		<div id="hc-name" :title="hisevent.name" :style="{width:namewidth+'PX'}">
			{{hisevent.name}}
		</div>
		<div id="hc-date">
			<span>
				{{hisevent.enddate}}
			</span>
			<br>
			<span>
				[<span>{{hisevent.state? "参加过":"未参与"}}</span>]
			</span>
		</div>
		<div >
			<van-button type="primary" size="small">查看详情</van-button>
		</div>
	</div>
</template>

<script>
export default{
	name:'history-competiton',
	props:["hisevent"],
	data(){
		return{
			namewidth:window.screen.availWidth/2.2
		}
	},
	methods:{
		stateinfo(i) {
			 if(i === false)
				return "未参与";
			 return "参与过";
			 
		}
	}
}
</script>

<style lang="scss">
	#history-competiton{
		background-color: #b0b0b0;
		border-radius: 10px;
		margin-top: 5px;
		padding: 5px;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: space-around;
		img{
			height: 50px;
		}
		#hc-name{
			text-align: center;
			white-space: nowrap;  /*强制span不换行*/
			display: inline-block;  /*将span当做块级元素对待*/
			overflow: hidden;  /*超出宽度部分隐藏*/
			text-overflow: ellipsis;  /*超出部分以点号代替*/
		}
		#hc-date{
			text-align:center;
			span span{
				color:#0000FF;
			}
		}
	}
</style>
